package com.zhangchuchu.neohealth.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("chat_message") // 指定数据库表名
public class ChatMessage {

    @TableId(type = IdType.AUTO) // 主键自增
    private Long id;

    private String sender; // 发送人
    private String recipient; // 接收人
    private String message; // 消息内容
    @TableField("send_avatar")
    private String sendAvatar;
    @TableField("recipient_avatar")
    private String recipientAvatar;
    @TableField(fill = FieldFill.INSERT) // 插入时自动填充
    private LocalDateTime timestamp; // 发送时间

    private Boolean isRead = false; // 是否已读，默认未读
    private Boolean isDeleted = false; // 是否删除，默认未删除

}
